home *** CD-ROM | disk | FTP | other *** search
- Path: news.umbc.edu!not-for-mail
- From: schlein@umbc.edu (Jonas J. Schlein)
- Newsgroups: comp.lang.c
- Subject: Re: A question on for loop..
- Date: 7 Mar 1996 18:28:24 -0500
- Organization: University of Maryland Baltimore County
- Message-ID: <4hnreo$55c@umbc9.umbc.edu>
- References: <4hn80a$98q@male.EBay.Sun.COM>
- NNTP-Posting-Host: umbc9.umbc.edu
- NNTP-Posting-User: schlein
-
- Murali Chari <murali@sooraj.ebay.sun.com> wrote:
- |> In the following piece of code:
- |>
- |> for(i=0;i< 20; i++)
- |> {
- ...
- |> if(condition==FALSE)
- |> continue;
- ...
- |> }
- |>
- |> Let us assume i=10 before it entered the loop.
- |> The condition was false. So the continue statement
- |> got executed.
- |>
- |> Will control now go to the third statement in the for loop?
- |> i.e. will i be incremented by 1 and again tested for the condition?
-
- Continue does exactly that. It says continue to the next loop iteration.
- Do not pass go do not pass $200 ;-). So, yes 'i' will be incremented
- and tested again. I'll just assume that FALSE is defined somewhere
- as well as 'condition'.
- --
- "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
-
- Jonas J. Schlein (schlein@gl.umbc.edu)
-